<!--
  测试统计页面
  User: YanZengBao
  Date: 2020-05-13
-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh">
<head>
    <meta charset="utf-8"/>
    <title>测试统计页面</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport"/>
    <meta content="" name="测试统计页面"/>
    <meta content="" name="GaoXiang"/>
    <th:block th:replace="body/head-page :: dva_head_page"/>
</head>

<body class="page-content-white  fade-in-up">

<input type="text" id="accountId"  class="hide" th:value="e541358919f0050ec2e46f83d2d35df6">

<div>
    今日入场数：<input type="text" id="countTodayPassRecord"><hr>
    今日总订单：<input type="text" id="countTodayOrder"><hr>
    今日总收费：<input type="text" id="countAllMoney"><hr>
    统计总车位：<input type="text" id="countAllParkinglot"><hr>
    统计剩余总车位：<input type="text" id="countSurPlusParkinglot">
</div>

<th:block th:replace="body/javascript-page :: javascript_page"/>
<script>

    $(document).ready(function () {

        countTodayPassRecord();//今日入场数
        countTodayOrder();//今日总订单
        countAllMoney();//今日总收费
        countParkinglot();//统计车位数量相关
    });

    //今日入场数
    function countTodayPassRecord() {
        var accountId = $("#accountId").val();
        $.ajax({
            url: "/front/countTodayPassRecord",
            type: "GET",
            data: {"accountId":accountId},
            dataType: "JSON",
            async:false,
            success: function (data) {
                console.log(data.data)
                $("#countTodayPassRecord").val(data.data);
            }
        });
    }

    //今日总订单
    function countTodayOrder() {
        var accountId = $("#accountId").val();
        $.ajax({
            url: "/front/countTodayOrder",
            type: "GET",
            data: {"accountId":accountId},
            dataType: "JSON",
            async:false,
            success: function (data) {
                $("#countTodayOrder").val(data.data);
            }
        });
    }

    //今日总收费
    function countAllMoney() {
        var accountId = $("#accountId").val();
        $.ajax({
            url: "/front/countAllMoney",
            type: "GET",
            data: {"accountId":accountId},
            dataType: "JSON",
            async:false,
            success: function (data) {
                $("#countAllMoney").val(data.data);
            }
        });
    }

    //统计车位数量
    function countParkinglot() {
        var accountId = $("#accountId").val();
        $.ajax({
            url: "/front/countParkinglot",
            type: "GET",
            data: {"accountId":accountId},
            dataType: "JSON",
            async:false,
            success: function (data) {
                console.log(data);
                $("#countAllParkinglot").val(data.data.allParkinglot);
                $("#countSurPlusParkinglot").val(data.data.allSurplus);
            }
        });
    }

</script>
</body>
</html>